!!!
%html
  %body
    .span15
      .container
        .col-md-12
          .row
            .page-header
              %h1
                Hashview Hub
            .row
              .col-md-10.pull-left
                Welcome to Hashview Hub. Here unlock hashes that have been cracked in the Hub. You can do so by hashfile or by hashtype.
      %br
      %br
      .container
        .row
          .col-md-12
            .table
              %table{class: 'table table'}
                %thead
                  %tr
                    %th
                      %b Hash Type
                    %th
                      %b Crack Rate
                    %th
                      %b Control
                %tbody
                  - if @cracked_by_hashtype_count
                    - @cracked_by_hashtype_count.each do |hashtype, value|
                      %tr
                        %td
                          #{modeToFriendly(hashtype)}
                        %td
                          #{value}
                        %td
                          %a.btn.btn-success{href: "#modal#{hashtype}", 'data-toggle' => 'modal'}
                            %i.glyphicon.glyphicon-cloud-download{title: 'Unlock from Hashview Hub'}
                          .modal.fade.modal{id: "modal#{hashtype}", role: 'dialog', tabindex: '-1', "aria-hidden" => 'true'}
                            .modal-dialog.modal-lg
                              .modal-content
                                .modal-header
                                  %button.close{'aria-label' => 'Close', 'data-dismiss' => 'modal', type: 'button'}
                                    %span{'aria-hidden' => 'true'} &times;
                                  %h4.modal-title Check Hashview Hub for #{modeToFriendly(hashtype)} hashes?
                                .modal-body
                                  %p
                                    Hashview will check the Hub for matching hashes that have already been cracked and unlock them locally.
                                    Note, this might take some time.
                                  %br
                                  .table
                                    %table{class: 'table'}
                                      %tr
                                        %td Total number of locally uncracked hashes: #{value}
                                      %tr
                                        %td
                                .modal-footer
                                  %button.btn.btn-default{'data-dismiss' => 'modal', type: 'button'} Close
                                  %a.btn.btn-success{type: 'button', href: "/hub/hash/reveal/hashtype/#{hashtype}"} Confirm